<?php
header('Content-type:text/html;charset=utf8');
/**
 * xysc users Version1.0
 * ==================================
 * Copy 2016-2017
 * Web:www.xjh7.com
 * ==================================
 * Author:xjh
 * Date:2016-3-1
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="stylesheet"  href="<?php echo backweb_CSS_URL;?>index.css" />
<link rel="stylesheet"  href="<?php echo backweb_CSS_URL;?>DialogBySHF.css" />
<link rel="stylesheet"  href="<?php echo backweb_CSS_URL;?>common.css" />
<script>

function updgoods($goods_id){
	parent.location.href="./index.php?r=backweb/goods/updategoods&goods_id="+$goods_id;
}


</script>
</head>
<body>
	
<div style="margin: 10px">
        <div >
        		<form action="./index.php?r=backweb/goods/sort" method="post" id="f" name="form1">
				<?php foreach ($infos as $v) {?>
				<input type="hidden" name="goods_id[]" value="<?php echo $v['goods_id']; ?>" id="h" />
				<?php }?>
              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="list_table">
                <tr>
                   <th width="80">编号</th>
                   <th width="400">商品名</th>
                   <th width="300">商品信息</th>
                   <th width="100">价格</th>
                   <th width="80">缩略图</th>
                   <th width="200">牌子</th>
                   <th width="200">分类</th>
                   <th width="200">属性配置</th>
                   <th width="200">参数配置</th>
                   <th width="240">关键词</th>
                   <th width="80">余量</th>
                   <th width="80">已售</th>
                   <th width="130">生产日期</th>
                   <th width="130">上架日期</th>
                   <th width="130">更新日期</th>
                   <th width="80">可用</th>
                   <th width="200">操作</th>
                   <th><input type="submit" name="send" value="排序" style="width:50px;height:25px;"  id="submit"  /></th>
                </tr>
         	<?php $i = 0;foreach ($infos as $v) {?>
         	<?php $i++;?>
         	<tr class="tr <?php if(!$v['active']) echo "disableded" ?>">
         		<td class="td_center"><?php echo $i; ?></td>
         		<td class="td_center"><a href="./index.php?r=goods/details&_goods_id=<?php echo $v['goods_id'];?>"><?php echo $v['goods_name']; ?></a></td>
         		<td class="td_center"><?php echo $v['goods_info']; ?></td>
         		<td class="td_center"><?php echo $v['goods_price']; ?></td>
         		<td class="td_center"><img src="<?php echo $v['goods_thumbnail_url'];?>" height="50px" width="50px" /></td>
         		<td class="td_center"><a href="./index.php?r=backweb/goods/goodshow&brand_id=<?php echo $v['brand_id'];?>"><?php echo $brand_info[$v['brand_id']];?></a></td>
         		<td class="td_center"><a href="./index.php?r=backweb/goods/goodshow&category_id=<?php echo $v['category_id'];?>"><?php echo $category_info[$v['category_id']];?></a></td>
         		<td class="td_center" ><input type="button" onclick="tc(<?php echo $v['goods_id'];?>,'<?php echo $v['goods_name'];?>')" value="配置" class="btn btn82 btn_search "   /></td>
         		<td class="td_center" ><input type="button" onclick="cs(<?php echo $v['goods_id'];?>,'<?php echo $v['goods_name'];?>')" value="配置" class="btn btn82 btn_search "   /></td>
         		<td class="td_center"><?php echo $v['goods_keyword'];?></td>
         		<td class="td_center"><?php echo $v['goods_rest'];?></td>
         		<td class="td_center"><?php echo $v['goods_sell'];?></td>
         		<td class="td_center"><?php echo $v['goods_birth'];?></td>
         		<td class="td_center"><?php echo $v['goods_time'];?></td>
         		<td class="td_center"><?php echo $v['goods_update_time'];?></td>
         		<td class="td_center" id="active" ><a onclick="<?php if($user_type == '商家') { echo "alert('对不起,你没有操作权限');"; echo 'return false;';} ?>" href="./index.php?r=backweb/goods/active&goods_id=<?php echo $v['goods_id']; ?>&active_id=<?php echo $v['active'];?>"><?php echo $active[$v['active']]; ?></a></td>
         		<td class="td_center"><a href="#" onclick="updgoods(<?php echo $v['goods_id'];?>)">修改</a>|<a href="./index.php?r=backweb/goods/delgoods&goods_id=<?php echo $v['goods_id'];?>">删除</a></td>
         		<td class="td_center" ><input type="text" name="sort[]" value="<?php echo $v['goods_sort']; ?>" style="width:40px;text-align:center;border:1px solid #ccc"  /></td></tr>
         	</tr>				
			<?php }?>
              </table>
			</form>
			<div class="page" style="text-align: center;margin-top: 5px">
                <div class="pagination">
                  <ul>
                      <li class="first-child"><?php echo $page_list[0];?></li>
                      <li class="disabled" ><?php echo $page_list[1];?></li>
                      <li class="active"><?php echo $page_list[2];?></li>
                      <li><?php echo $page_list[3];?></li>
                      <li><?php echo $page_list[4];?></li>
                  </ul>
			</div>
			</div>
        </div>
        
        	<div style="text-align:center;">
				<p>共执行<em style="font-weight:bold;"><?php echo $number;?></em>个sql，查询到<em style="font-weight:bold;"><?php echo $info_count;?></em>条记录，用时 <em style="font-weight:bold;"><?php echo $times;?></em> 秒</p>
				<p>版权所有 © 2016-2017 <em style="font-weight:bold;">xjh&lj</em>，并保留所有权利。</p>
			</div>
     </div>
<script type="text/javascript" src="<?php echo backweb_JS_URL;?>jquery.js"></script>
<script type="text/javascript" src="<?php echo backweb_JS_URL;?>DialogBySHF.js"></script>
<script type="text/javascript">
            function tc(id,goods_name){
            	$.DialogBySHF.Dialog({ Width: 1024, Height: 2000, Title: goods_name, URL: './index.php?r=backweb/goods/goodsAttrConfig&goods_id='+id });
            }
            function cs(id,goods_name){
            	$.DialogBySHF.Dialog({ Width: 1024, Height: 2000, Title: goods_name, URL: './index.php?r=backweb/goods/goodsParamConfig&goods_id='+id });
            }
</script>
</body>
<body>